package br.inf.ufpr.formulario.domain;

import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import javassist.bytecode.ByteArray;
import javax.validation.constraints.NotNull;

import java.sql.Blob;
import java.util.ArrayList;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.Lob;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.print.DocFlavor.CHAR_ARRAY;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Set;
import br.inf.ufpr.formulario.domain.Formacao_E;
import java.util.HashSet;
import javax.persistence.ManyToMany;
import javax.persistence.CascadeType;
import br.inf.ufpr.formulario.domain.Nivel_E;

@RooJavaBean
@RooToString
@RooEntity
public class Pessoa_E {

    @NotNull
    private String nomeCompleto;

    @NotNull
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "S-")
    private Date nascimento;

    @NotNull
    private String localNascimento;

    @NotNull
    private String cpf;

    @NotNull
    private String rg;

    @NotNull
    private String endereco;

    @NotNull
    private String cidade;

    @NotNull
    private String estado;

    @NotNull
    private String cep;

    @NotNull
    private String fone;

    @NotNull
    private String celular;

    @NotNull
    private String email;

//    @NotNull
//    @Lob
//    @Basic(fetch = FetchType.LAZY)
//    private byte[] foto;
    
    @Column(name="foto")
    @Lob
    private Blob foto;

    @ManyToMany(cascade = CascadeType.ALL)
    private Set<Formacao_E> listaFormacao = new HashSet<Formacao_E>();

    @ManyToMany(cascade = CascadeType.ALL)
    private Set<Nivel_E> listaNivel = new HashSet<Nivel_E>();
}
